home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / CALLING_ / CALLIN.ICN < prev    next >
Text File  |  1990-04-08  |  747b  |  42 lines

  1.  
  2. procedure main()
  3.    write(&version)
  4.    write(&host)
  5.    every write(&features)
  6. end
  7.  
  8. procedure wordcount(n)
  9.    local t, line, x, i
  10.    static letters
  11.    initial letters := &lcase ++ &ucase
  12.    t := table(0)
  13.    while line := read() do
  14.       line ? while tab(upto(letters)) do
  15.          t[tab(many(letters))] +:= 1
  16.    x := sort(t,3)
  17.    every i := 1 to *x - 1 by 2 do
  18.       write(left(x[i],n),x[i + 1])
  19.    return "true"
  20. end
  21.  
  22. procedure testing(n)
  23.    static cnt
  24.    initial cnt := 2
  25.    /n := -1
  26.    if (n < 0) then
  27.       fail
  28.    else if (n = 0) then
  29.       return n
  30.    while n > 0 do {
  31.       m := cnt
  32.       cnt -:= 1
  33.       suspend m
  34.       }
  35. end
  36.  
  37. procedure junk()
  38.    write(reverse("this is not a test"))
  39.    display()
  40.    write(find("is", "this is a test"))
  41. end
  42.